home *** CD-ROM | disk | FTP | other *** search
/ IRIX Patches 1995 June / SGI IRIX Patches 1995 Jun.iso / 5.3_patches / patchSG0000499 / patchSG0000499.idb / usr / include / abi / X11 / extensions / XKBsrv.h.z / XKBsrv.h
Encoding:
C/C++ Source or Header  |  1995-06-12  |  12.5 KB  |  531 lines

  1. /* $XConsortium: XKBsrv.h,v 1.11 94/04/08 15:07:52 erik Exp $ */
  2. /************************************************************
  3. Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
  4.  
  5. Permission to use, copy, modify, and distribute this
  6. software and its documentation for any purpose and without
  7. fee is hereby granted, provided that the above copyright
  8. notice appear in all copies and that both that copyright
  9. notice and this permission notice appear in supporting
  10. documentation, and that the name of Silicon Graphics not be 
  11. used in advertising or publicity pertaining to distribution 
  12. of the software without specific prior written permission.
  13. Silicon Graphics makes no representation about the suitability 
  14. of this software for any purpose. It is provided "as is"
  15. without any express or implied warranty.
  16.  
  17. SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
  18. SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
  19. AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
  20. GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
  21. DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
  22. DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
  23. OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
  24. THE USE OR PERFORMANCE OF THIS SOFTWARE.
  25.  
  26. ********************************************************/
  27.  
  28. #ifndef _XKBSRV_H_
  29. #define    _XKBSRV_H_
  30.  
  31. #include <X11/extensions/XKBproto.h>
  32. #include <X11/extensions/XKBstr.h>
  33.  
  34. typedef struct _XkbInterestRec {
  35.     struct _XkbSrvInfo    *kbd;
  36.     ClientRec        *client;
  37.     CARD16             stateNotifyMask;
  38.     CARD16             namesNotifyMask;
  39.     CARD32              ctrlsNotifyMask;
  40.     CARD8             compatNotifyMask;
  41.     BOOL             bellNotifyWanted;
  42.     BOOL             actionMessageWanted;
  43.     CARD8             slowKeyNotifyMask;
  44.     CARD32             iStateNotifyMask;
  45.     CARD32             iMapNotifyMask;
  46.     CARD16             altSymsNotifyMask;
  47.     XID             resource;
  48.     struct _XkbInterestRec    *next;
  49. } XkbInterestRec,*XkbInterestPtr;
  50.  
  51. typedef struct _XkbRadioGroup {
  52.     CARD8        flags;
  53.     CARD8        nMembers;
  54.     CARD8        dfltDown;
  55.     CARD8        currentDown;
  56.     CARD8        members[XkbRGMaxMembers];
  57. } XkbRadioGroupRec, *XkbRadioGroupPtr;
  58.  
  59. #define    _OFF_TIMER        0
  60. #define    _KRG_WARN_TIMER        1
  61. #define    _KRG_TIMER        2
  62. #define    _SK_TIMEOUT_TIMER    3
  63. #define    _ALL_TIMEOUT_TIMER    4
  64.  
  65. #define    _BEEP_NONE        0
  66. #define    _BEEP_FEATURE_ON    1
  67. #define    _BEEP_FEATURE_OFF    2
  68. #define    _BEEP_FEATURE_CHANGE    3
  69. #define    _BEEP_SLOW_WARN        4
  70. #define    _BEEP_SLOW_PRESS    5
  71. #define    _BEEP_SLOW_ACCEPT    6
  72. #define    _BEEP_SLOW_REJECT    7
  73. #define    _BEEP_STICKY_LATCH    8
  74. #define    _BEEP_STICKY_LOCK    9
  75. #define    _BEEP_STICKY_UNLOCK    10
  76. #define    _BEEP_LED_ON        11
  77. #define    _BEEP_LED_OFF        12
  78. #define    _BEEP_LED_CHANGE    13
  79.  
  80. typedef struct _XkbSrvInfo {
  81.     XkbStateRec     state;
  82.     XkbControlsRec     Controls;
  83.     XkbServerMapRec     Server;
  84.     XkbClientMapRec     Map;
  85.     XkbIndicatorRec     Indicators;
  86.     XkbNamesRec     Names;
  87.     XkbCompatRec     Compat;
  88.     XkbDescRec     desc;
  89.  
  90.     DeviceIntRec    *device;
  91.  
  92.     XkbRadioGroupRec *radioGroups;
  93.     CARD8         nRadioGroups;
  94.     CARD8         clearMods;
  95.     CARD8         setMods;
  96.     INT16         groupChange;
  97.  
  98.     CARD16         dfltPtrDelta;
  99.  
  100.     double         mouseKeysCurve;
  101.     double         mouseKeysCurveFactor;
  102.     INT16         mouseKeysDX;
  103.     INT16         mouseKeysDY;
  104.     CARD8         mouseKeysAccel;
  105.     CARD8         mouseKeysCounter;
  106.  
  107.     CARD8         lockedPtrButtons;
  108.     CARD8         shiftKeyCount;
  109.     KeyCode         mouseKey;
  110.     KeyCode         inactiveKey;
  111.     KeyCode         slowKey;
  112.     KeyCode         repeatKey;
  113.     CARD8         krgTimerActive;
  114.     CARD8         beepType;
  115.     CARD8         beepCount;
  116.  
  117.     CARD32         accessXFlags;
  118.     CARD32         lastPtrEventTime;
  119.     OsTimerPtr     beepTimer;
  120.     OsTimerPtr     mouseKeyTimer;
  121.     OsTimerPtr     slowKeysTimer;
  122.     OsTimerPtr     bounceKeysTimer;
  123.     OsTimerPtr     repeatKeyTimer;
  124.     OsTimerPtr     krgTimer;
  125.  
  126.     CARD8         compatLookupState;
  127.     CARD8         compatGrabState;
  128.     CARD16         lookupState;
  129.     CARD16         grabState;
  130.  
  131.      struct {
  132.         CARD32         usesBase;
  133.         CARD32         usesLatched;
  134.         CARD32         usesLocked;
  135.         CARD32         usesEffective;
  136.         CARD32         usesCompat;
  137.         CARD32         usesControls;
  138.         CARD32         usedComponents;
  139.         CARD32         haveMap;
  140.     } iAccel;
  141.     CARD32         iStateAuto;
  142.     CARD32         iStateExplicit;
  143.     CARD32         iStateEffective;
  144.  
  145.     CARD8         repeat[32];
  146.  
  147.     XkbInterestRec    *interest;
  148. } XkbSrvInfoRec, *XkbSrvInfoPtr;
  149.  
  150. /************************************************************************
  151.  *
  152.  * Masks for setting/determining the accessx ctrl state.
  153.  */
  154. #define ALLOW_ACCESSX_MASK              (1 << 0)
  155. #define MOUSE_KEYS_MASK                 (1 << 2)
  156. #define TOGGLE_KEYS_MASK                (1 << 3)
  157. #define TWO_KEYS_MASK                   (1 << 6)
  158. #define TIME_OUT_MASK                   (1 << 7)
  159. #define NO_LOCK_ON_TWO_MASK             (1 << 8)
  160. #define STICKY_ONOFF_SOUND_MASK         (1 << 9)
  161. #define STICKY_MOD_SOUND_MASK           (1 << 10)
  162. #define MOUSE_ONOFF_SOUND_MASK          (1 << 11)
  163. #define TOGGLE_ONOFF_SOUND_MASK         (1 << 12)
  164. #define KRG_ONOFF_SOUND_MASK            (1 << 13)
  165. #define KRG_PRESS_SOUND_MASK            (1 << 14)
  166. #define KRG_ACCEPT_SOUND_MASK           (1 << 15)
  167.  
  168. #define KRG_MASK                (XkbSlowKeysMask|XkbBounceKeysMask)
  169.  
  170. #define    ALL_FILTERED_MASK    (XkbRepeatKeysMask|KRG_MASK)
  171. #define ANY_OPTIONS_MASK        (XkbStickyKeysMask|XkbMouseKeysMask|KRG_MASK)
  172.  
  173. /************************************************************************
  174.  *
  175.  * Masks for setting/determining the accessx status.
  176.  */
  177. #define BLOCK_AND_WAKEUP_MASK   (1 << 0)
  178. #define HOLDING_MOUSE_KEY_MASK  (1 << 1)
  179. #define MOVING_MOUSE_MASK       (1 << 2)
  180. #define MOVING_STEADY_MASK      (1 << 3)
  181. #define HOLDING_KRG_KEY_MASK    (1 << 4)
  182. #define HOLDING_SLOW_KEY_MASK   (1 << 5)
  183. #define ISSUED_WARNING_MASK     (1 << 6)
  184. #define REPEATING_MASK          (1 << 7)
  185. #define CALLED_TWO_KEYS_MASK    (1 << 8)
  186. #define WAITING_TO_TIMEOUT_MASK (1 << 9)
  187.  
  188. #define X_AccessXStickyKeysOn           0
  189. #define X_AccessXStickyKeysOff          1
  190. #define X_AccessXMouseKeysOn            2
  191. #define X_AccessXMouseKeysOff           3
  192. #define X_AccessXKRGWarning             4
  193. #define X_AccessXKRGOn                  5
  194. #define X_AccessXKRGOff                 6
  195. #define X_AccessXToggleKeysOn           7
  196. #define X_AccessXToggleKeysOff          8
  197. #define X_AccessXToggleKeyDown          9
  198. #define X_AccessXToggleKeyUp            10
  199. #define X_AccessXModifierLatch          11
  200. #define X_AccessXModifierUnlatch        12
  201. #define X_AccessXModifierLock           13
  202. #define X_AccessXModifierUnlock         14
  203. #define X_AccessXPressSlowKey           15
  204. #define X_AccessXAcceptSlowKey          16
  205. #define X_AccessXChangeCurrentButton    17
  206. #define X_AccessXPressButton            18
  207. #define X_AccessXReleaseButton          19
  208.  
  209. extern int    XkbEventBase;
  210. extern int    XkbDisableLockActions;
  211.  
  212. #ifdef DEBUG
  213. extern CARD16    xkbDebugFlags;
  214. #endif
  215.  
  216. _XFUNCPROTOBEGIN
  217.  
  218. extern DeviceIntPtr XkbLookupDevice(
  219. #if NeedFunctionPrototypes
  220.     int            /* id */
  221. #endif
  222. );
  223.  
  224. extern Bool XkbApplyVirtualModChanges(
  225. #if NeedFunctionPrototypes
  226.     XkbSrvInfoPtr    /* xkb */,
  227.     unsigned        /* changed */,
  228.     XkbChangesPtr    /* pChanges */
  229. #endif
  230. );
  231.  
  232. extern    unsigned XkbMaskForVMask(
  233. #if NeedFunctionPrototypes
  234.     XkbDescPtr        /* xkb */,
  235.     unsigned        /* vmask */
  236. #endif
  237. );
  238.  
  239. extern KeySym *_XkbNewSymsForKey(
  240. #if NeedFunctionPrototypes
  241.     XkbDescRec *    /* xkb */,
  242.     unsigned         /* key */,
  243.     unsigned         /* needed */
  244. #endif
  245. );
  246.  
  247. extern XkbAction *_XkbNewActionsForKey(
  248. #if NeedFunctionPrototypes
  249.     XkbDescRec *    /* xkb */,
  250.     unsigned         /* key */,
  251.     unsigned         /* needed */
  252. #endif
  253. );
  254.  
  255. extern void XkbUpdateKeyTypes(
  256. #if NeedFunctionPrototypes
  257.     DeviceIntPtr    /* pXDev */,
  258.     KeyCode         /* first */,
  259.     CARD8         /* num */,
  260.     XkbChangesPtr    /* pChanges */
  261. #endif
  262. );
  263.  
  264. extern void XkbUpdateKeyTypesFromCore(
  265. #if NeedFunctionPrototypes
  266.     DeviceIntPtr    /* pXDev */,
  267.     KeyCode         /* first */,
  268.     CARD8         /* num */,
  269.     XkbChangesPtr    /* pChanges */
  270. #endif
  271. );
  272.  
  273. void
  274. XkbUpdateActions(
  275. #if NeedFunctionPrototypes
  276.     DeviceIntPtr    /* pXDev */,
  277.     KeyCode         /* first */,
  278.     CARD8         /* num */,
  279.     XkbChangesPtr      /* pChanges */
  280. #endif
  281. );
  282.  
  283. extern void XkbApplyMappingChange(
  284. #if NeedFunctionPrototypes
  285.     DeviceIntPtr    /* pXDev */,
  286.     CARD8         /* request */,
  287.     KeyCode         /* firstKey */,
  288.     CARD8         /* num */
  289. #endif
  290. );
  291.  
  292. extern void XkbSetIndicators(
  293. #if NeedFunctionPrototypes
  294.     DeviceIntPtr        /* pXDev */,
  295.     CARD32            /* affect */,
  296.     CARD32            /* values */,
  297.     XkbIndicatorChangesPtr    /* pChanges */
  298. #endif
  299. );
  300.  
  301. extern void XkbUpdateIndicators(
  302. #if NeedFunctionPrototypes
  303.     DeviceIntPtr        /* keybd */,
  304.     CARD32             /* changed */,
  305.     XkbIndicatorChangesRec *    /* pChanges */
  306. #endif
  307. );
  308.  
  309. extern void XkbComputeDerivedState(
  310. #if NeedFunctionPrototypes
  311.     XkbSrvInfoRec *        /* xkb */
  312. #endif
  313. );
  314.  
  315. extern unsigned XkbStateChangedFlags(
  316. #if NeedFunctionPrototypes
  317.     XkbStateRec *    /* old */,
  318.     XkbStateRec *    /* new */
  319. #endif
  320. );
  321.  
  322. extern    void XkbSendStateNotify(
  323. #if NeedFunctionPrototypes
  324.        DeviceIntPtr    /* kbd */,
  325.        xkbStateNotify *    /* pSN */
  326. #endif
  327. );
  328.  
  329. extern    void XkbSendMapNotify(
  330. #if NeedFunctionPrototypes
  331.        DeviceIntPtr    /* kbd */,
  332.        xkbMapNotify *    /* ev */
  333. #endif
  334. );
  335.  
  336. extern    int  XkbComputeControlsNotify(
  337. #if NeedFunctionPrototypes
  338.     DeviceIntPtr        /* kbd */,
  339.     XkbControlsRec *    /* old */,
  340.     XkbControlsRec *    /* new */,
  341.     xkbControlsNotify *    /* pCN */
  342. #endif
  343. );
  344.  
  345. extern    void XkbSendControlsNotify(
  346. #if NeedFunctionPrototypes
  347.        DeviceIntPtr        /* kbd */,
  348.        xkbControlsNotify *    /* ev */
  349. #endif
  350. );
  351.  
  352. extern    void XkbSendIndicatorNotify(
  353. #if NeedFunctionPrototypes
  354.        DeviceIntPtr        /* kbd */,
  355.        xkbIndicatorNotify *    /* ev */
  356. #endif
  357. );
  358.  
  359. extern    void XkbHandleBell(
  360. #if NeedFunctionPrototypes
  361.        BOOL        /* force */,
  362.        DeviceIntPtr    /* kbd */,
  363.        CARD8        /* percent */,
  364.        pointer         /* ctrl */,
  365.        CARD8        /* class */,
  366.        Atom        /* name */,
  367.        WindowPtr    /* pWin */,
  368.        ClientPtr    /* pClient */
  369. #endif
  370. );
  371.  
  372. extern    void XkbSendSlowKeyNotify(
  373. #if NeedFunctionPrototypes
  374.        DeviceIntPtr        /* kbd */,
  375.        xkbSlowKeyNotify *    /* pEv */
  376. #endif
  377. );
  378.  
  379. extern    void XkbSendNamesNotify(
  380. #if NeedFunctionPrototypes
  381.        DeviceIntPtr    /* kbd */,
  382.        xkbNamesNotify *    /* ev */
  383. #endif
  384. );
  385.  
  386. extern    void XkbSendCompatNotify(
  387. #if NeedFunctionPrototypes
  388.        DeviceIntPtr        /* kbd */,
  389.        xkbCompatMapNotify *    /* ev */
  390. #endif
  391. );
  392.  
  393. extern    void XkbSendActionMessage(
  394. #if NeedFunctionPrototypes
  395.        DeviceIntPtr        /* kbd */,
  396.        xkbActionMessage *    /* ev */
  397. #endif
  398. );
  399.  
  400. extern void XkbSendNotification(
  401. #if NeedFunctionPrototypes
  402.     DeviceIntPtr        /* kbd */,
  403.     XkbChangesRec *        /* pChanges */,
  404.     unsigned            /* keycode */,
  405.     unsigned            /* eventType */,
  406.     unsigned            /* reqMajor */,
  407.     unsigned            /* reqMinor */
  408. #endif
  409. );
  410.  
  411. extern void XkbProcessKeyboardEvent(
  412. #if NeedFunctionPrototypes
  413.     xEvent *             /* xE */,
  414.     DeviceIntPtr        /* keybd */,
  415.     int             /* count */
  416. #endif
  417. );
  418.  
  419. extern    XkbInterestRec *XkbFindClientResource(
  420. #if NeedFunctionPrototypes
  421.        DevicePtr    /* inDev */,
  422.        ClientPtr    /* client */
  423. #endif
  424. );
  425.  
  426. extern    XkbInterestRec *XkbAddClientResource(
  427. #if NeedFunctionPrototypes
  428.        DevicePtr    /* inDev */,
  429.        ClientPtr    /* client */,
  430.        XID        /* id */
  431. #endif
  432. );
  433.  
  434. extern    int XkbRemoveClient(
  435. #if NeedFunctionPrototypes
  436.        DevicePtr    /* inDev */,
  437.        ClientPtr    /* client */
  438. #endif
  439. );
  440.  
  441. extern    int XkbRemoveResourceClient(
  442. #if NeedFunctionPrototypes
  443.        DevicePtr    /* inDev */,
  444.        XID        /* id */
  445. #endif
  446. );
  447.  
  448. extern    void DDXUpdateIndicators(
  449. #if NeedFunctionPrototypes
  450.     DeviceIntPtr    /* keybd */,
  451.     CARD32        /* oldState */,
  452.     CARD32        /* newState */
  453. #endif
  454. );
  455.  
  456. extern    void XkbDisableComputedAutoRepeats(
  457. #if NeedFunctionPrototypes
  458.     DeviceIntPtr     /* pXDev */,
  459.     unsigned        /* key */
  460. #endif
  461. );
  462.  
  463. extern    void XkbSetRepeatKeys(
  464. #if NeedFunctionPrototypes
  465.     DeviceIntPtr     /* pXDev */,
  466.     int             /* onoff */
  467. #endif
  468. );
  469.  
  470. extern    int XkbUsesSoftRepeat(
  471. #if NeedFunctionPrototypes
  472.     DeviceIntPtr     /* pXDev */
  473. #endif
  474. );
  475.  
  476. extern    int SProcXkbDispatch(
  477. #if NeedFunctionPrototypes
  478.     ClientPtr    /* client */
  479. #endif
  480. );
  481.  
  482. #ifdef XKMFORMAT_H
  483.  
  484. extern Bool    XkmReadTOC(
  485. #if NeedFunctionPrototypes
  486.     FILE *              /* file */,
  487.     XkbDescPtr          /* xkb */,
  488.     xkmFileInfo *       /* file_info */,
  489.     int                 /* max_toc */,
  490.     xkmSectionInfo *    /* toc */
  491. #endif
  492. );
  493.  
  494. extern xkmSectionInfo *XkmFindTOCEntry(
  495. #if NeedFunctionPrototypes
  496.     xkmFileInfo *       /* finfo */,
  497.     xkmSectionInfo *    /* toc */,
  498.     unsigned            /* type */
  499. #endif
  500. );
  501.  
  502. extern Bool    XkmReadFileSection(
  503. #if NeedFunctionPrototypes
  504.     FILE *              /* file */,
  505.     xkmSectionInfo *    /* toc */,
  506.     DeviceIntRec *      /* dev */,
  507.     unsigned *          /* loaded_rtrn */
  508. #endif
  509. );
  510.  
  511. extern    Bool XkmReadFile(
  512. #if NeedFunctionPrototypes
  513.     FILE *              /* file */,
  514.     unsigned            /* type */,
  515.     DeviceIntRec *      /* dev */,
  516.     unsigned *          /* loaded_rtrn */
  517. #endif
  518. );
  519. #endif /* XKMFORMAT_H */
  520.  
  521. _XFUNCPROTOEND
  522.  
  523.     /*
  524.      * bits in xkbClientFlags field of 
  525.      * ClientRec structure
  526.      */
  527. #define    XKB_INITIALIZED    (1<<0)
  528. #define    XkbIMMEDIATE    (1<<1)
  529.  
  530. #endif /* _XKBSRV_H_ */
  531.